package cn.me.alphamq.nameserver.event.spi.listener.cluster.chain;

import cn.me.alphamq.nameserver.event.model.cluster.ReplicationAckEvent;
import cn.me.alphamq.common.event.Listener;
import cn.me.alphamq.common.store.StopWatchManager;

/**
 * 链式复制中非尾节点的监听器，用于监听下一个节点复制完毕返回的 ack 事件
 *
 * @author f
 */
public class NodeReplicationAckListener implements Listener<ReplicationAckEvent> {
    @Override
    public void onReceive(ReplicationAckEvent event) throws Exception {
        // 唤醒阻塞的线程
        StopWatchManager.resumeAndRemove(event.getMsgId());
    }
}
